using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace Easycmd
{
    public class Util
    {
        public static bool CheckError(bool cond, string error)
        {
            //if ((!cond) && (error!="")) throw new CheckStopException(error);
            if (cond && !string.IsNullOrEmpty(error))  MessageBox.Show(error);
            return cond;
        }
        public static bool CheckError(bool cond)
        {
            return CheckError(cond, "");
        }
        public static void Expect(bool cond)
        {
            if (!cond)
                throw new AbortException("");
        }
    }
    public class AbortException : Exception
    {
        public AbortException(string error):base(error){}       
    }

}
